/**
 * @param {string[]} words
 * @return {number}
 */
var maximumNumberOfStringPairs = function (words) {
	const n = words.length
	let ans = 0
	for (let i = 0; i < n; ++i) {
		for (let j = i + 1; j < n; ++j) {
			if (words[i][0] == words[j][1] && words[i][1] == words[j][0]) {
				++ans
				break
			}
		}
	}
	return ans
}
const words = ['ab', 'ba', 'cc']
const ret = maximumNumberOfStringPairs(words)
console.log('ret :>>', ret)
